{
 "cells": [
  {
   "cell_type": "code",
   "id": "initial_id",
   "metadata": {
    "collapsed": true,
    "ExecuteTime": {
     "end_time": "2025-03-15T14:54:48.995680Z",
     "start_time": "2025-03-15T14:54:48.613449Z"
    }
   },
   "source": [
    "import cv2\n",
    "import os\n",
    "from collections import deque"
   ],
   "outputs": [],
   "execution_count": 2
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-03-15T14:54:49.042159Z",
     "start_time": "2025-03-15T14:54:49.029833Z"
    }
   },
   "cell_type": "code",
   "source": [
    "def process_video(video_path, output_dir, batch_size=2):\n",
    "    # 初始化视频捕获对象\n",
    "    cap = cv2.VideoCapture(video_path)\n",
    "    if not cap.isOpened():\n",
    "        raise ValueError(\"无法打开视频文件\")\n",
    "    \n",
    "    # 获取视频帧率和总帧数\n",
    "    fps = cap.get(cv2.CAP_PROP_FPS)\n",
    "    frame_interval = int(fps)  # 每秒截取一帧\n",
    "    total_frames = int(cap.get(cv2.CAP_PROP_FRAME_COUNT))\n",
    "    \n",
    "    # 初始化队列和批次计数器\n",
    "    frame_queue = deque(maxlen=batch_size)\n",
    "    batch_num = 0\n",
    "    current_frame = 0\n",
    "    \n",
    "    while cap.isOpened():\n",
    "        ret, frame = cap.read()\n",
    "        if not ret:\n",
    "            break\n",
    "        \n",
    "        # 每秒提取一帧（例如30fps视频取第0、30、60...帧）\n",
    "        if current_frame % frame_interval == 0:\n",
    "            frame_queue.append(frame)\n",
    "            print(f\"已缓存帧：{len(frame_queue)}/{batch_size}\")\n",
    "            \n",
    "            # 当队列满时保存批次\n",
    "            if len(frame_queue) == batch_size:\n",
    "                batch_dir = os.path.join(output_dir, f\"batch_{batch_num}\")\n",
    "                os.makedirs(batch_dir, exist_ok=True)\n",
    "                \n",
    "                # 保存队列中的帧到子文件夹\n",
    "                for idx, img in enumerate(frame_queue):\n",
    "                    cv2.imwrite(f\"{batch_dir}/frame_{idx}.jpg\", img)\n",
    "                print(f\"已保存批次 {batch_num} 至 {batch_dir}\")\n",
    "                \n",
    "                # 弹出队首并重置队列（保留最新一帧作为下一批的起始）\n",
    "                frame_queue.popleft()\n",
    "                batch_num += 1\n",
    "        \n",
    "        current_frame += 1\n",
    "        print(f\"处理进度：{current_frame/total_frames*100:.1f}%\", end='\\r')\n",
    "    \n",
    "    cap.release()\n",
    "    print(\"\\n处理完成！\")"
   ],
   "id": "833985a102031265",
   "outputs": [],
   "execution_count": 3
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-03-15T14:55:16.043072Z",
     "start_time": "2025-03-15T14:54:50.604879Z"
    }
   },
   "cell_type": "code",
   "source": "process_video(\"2.mp4\", \"output_frames\")",
   "id": "15394b28330d8ae2",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "已缓存帧：1/2\n",
      "已缓存帧：2/2%\n",
      "已保存批次 0 至 output_frames\\batch_0\n",
      "已缓存帧：2/2%\n",
      "已保存批次 1 至 output_frames\\batch_1\n",
      "已缓存帧：2/2%\n",
      "已保存批次 2 至 output_frames\\batch_2\n",
      "已缓存帧：2/2%\n",
      "已保存批次 3 至 output_frames\\batch_3\n",
      "已缓存帧：2/2%\n",
      "已保存批次 4 至 output_frames\\batch_4\n",
      "已缓存帧：2/2%\n",
      "已保存批次 5 至 output_frames\\batch_5\n",
      "已缓存帧：2/2%\n",
      "已保存批次 6 至 output_frames\\batch_6\n",
      "已缓存帧：2/2%\n",
      "已保存批次 7 至 output_frames\\batch_7\n",
      "已缓存帧：2/2%\n",
      "已保存批次 8 至 output_frames\\batch_8\n",
      "已缓存帧：2/2%\n",
      "已保存批次 9 至 output_frames\\batch_9\n",
      "已缓存帧：2/2%\n",
      "已保存批次 10 至 output_frames\\batch_10\n",
      "已缓存帧：2/2%\n",
      "已保存批次 11 至 output_frames\\batch_11\n",
      "已缓存帧：2/2%\n",
      "已保存批次 12 至 output_frames\\batch_12\n",
      "已缓存帧：2/2%\n",
      "已保存批次 13 至 output_frames\\batch_13\n",
      "已缓存帧：2/2%\n",
      "已保存批次 14 至 output_frames\\batch_14\n",
      "已缓存帧：2/2%\n",
      "已保存批次 15 至 output_frames\\batch_15\n",
      "已缓存帧：2/2%\n",
      "已保存批次 16 至 output_frames\\batch_16\n",
      "已缓存帧：2/2%\n",
      "已保存批次 17 至 output_frames\\batch_17\n",
      "已缓存帧：2/2%\n",
      "已保存批次 18 至 output_frames\\batch_18\n",
      "已缓存帧：2/2%\n",
      "已保存批次 19 至 output_frames\\batch_19\n",
      "已缓存帧：2/2%\n",
      "已保存批次 20 至 output_frames\\batch_20\n",
      "已缓存帧：2/2%\n",
      "已保存批次 21 至 output_frames\\batch_21\n",
      "已缓存帧：2/2%\n",
      "已保存批次 22 至 output_frames\\batch_22\n",
      "已缓存帧：2/2%\n",
      "已保存批次 23 至 output_frames\\batch_23\n",
      "已缓存帧：2/2%\n",
      "已保存批次 24 至 output_frames\\batch_24\n",
      "已缓存帧：2/2%\n",
      "已保存批次 25 至 output_frames\\batch_25\n",
      "已缓存帧：2/2%\n",
      "已保存批次 26 至 output_frames\\batch_26\n",
      "已缓存帧：2/2%\n",
      "已保存批次 27 至 output_frames\\batch_27\n",
      "已缓存帧：2/21%\n",
      "已保存批次 28 至 output_frames\\batch_28\n",
      "已缓存帧：2/24%\n",
      "已保存批次 29 至 output_frames\\batch_29\n",
      "已缓存帧：2/28%\n",
      "已保存批次 30 至 output_frames\\batch_30\n",
      "已缓存帧：2/21%\n",
      "已保存批次 31 至 output_frames\\batch_31\n",
      "已缓存帧：2/25%\n",
      "已保存批次 32 至 output_frames\\batch_32\n",
      "已缓存帧：2/28%\n",
      "已保存批次 33 至 output_frames\\batch_33\n",
      "已缓存帧：2/22%\n",
      "已保存批次 34 至 output_frames\\batch_34\n",
      "已缓存帧：2/25%\n",
      "已保存批次 35 至 output_frames\\batch_35\n",
      "已缓存帧：2/29%\n",
      "已保存批次 36 至 output_frames\\batch_36\n",
      "已缓存帧：2/22%\n",
      "已保存批次 37 至 output_frames\\batch_37\n",
      "已缓存帧：2/26%\n",
      "已保存批次 38 至 output_frames\\batch_38\n",
      "已缓存帧：2/29%\n",
      "已保存批次 39 至 output_frames\\batch_39\n",
      "已缓存帧：2/23%\n",
      "已保存批次 40 至 output_frames\\batch_40\n",
      "已缓存帧：2/26%\n",
      "已保存批次 41 至 output_frames\\batch_41\n",
      "已缓存帧：2/20%\n",
      "已保存批次 42 至 output_frames\\batch_42\n",
      "已缓存帧：2/23%\n",
      "已保存批次 43 至 output_frames\\batch_43\n",
      "已缓存帧：2/26%\n",
      "已保存批次 44 至 output_frames\\batch_44\n",
      "已缓存帧：2/20%\n",
      "已保存批次 45 至 output_frames\\batch_45\n",
      "已缓存帧：2/23%\n",
      "已保存批次 46 至 output_frames\\batch_46\n",
      "已缓存帧：2/27%\n",
      "已保存批次 47 至 output_frames\\batch_47\n",
      "已缓存帧：2/20%\n",
      "已保存批次 48 至 output_frames\\batch_48\n",
      "已缓存帧：2/24%\n",
      "已保存批次 49 至 output_frames\\batch_49\n",
      "已缓存帧：2/27%\n",
      "已保存批次 50 至 output_frames\\batch_50\n",
      "已缓存帧：2/21%\n",
      "已保存批次 51 至 output_frames\\batch_51\n",
      "已缓存帧：2/24%\n",
      "已保存批次 52 至 output_frames\\batch_52\n",
      "已缓存帧：2/28%\n",
      "已保存批次 53 至 output_frames\\batch_53\n",
      "已缓存帧：2/21%\n",
      "已保存批次 54 至 output_frames\\batch_54\n",
      "已缓存帧：2/25%\n",
      "已保存批次 55 至 output_frames\\batch_55\n",
      "已缓存帧：2/28%\n",
      "已保存批次 56 至 output_frames\\batch_56\n",
      "已缓存帧：2/22%\n",
      "已保存批次 57 至 output_frames\\batch_57\n",
      "已缓存帧：2/25%\n",
      "已保存批次 58 至 output_frames\\batch_58\n",
      "已缓存帧：2/29%\n",
      "已保存批次 59 至 output_frames\\batch_59\n",
      "已缓存帧：2/22%\n",
      "已保存批次 60 至 output_frames\\batch_60\n",
      "已缓存帧：2/26%\n",
      "已保存批次 61 至 output_frames\\batch_61\n",
      "已缓存帧：2/29%\n",
      "已保存批次 62 至 output_frames\\batch_62\n",
      "已缓存帧：2/23%\n",
      "已保存批次 63 至 output_frames\\batch_63\n",
      "已缓存帧：2/26%\n",
      "已保存批次 64 至 output_frames\\batch_64\n",
      "已缓存帧：2/20%\n",
      "已保存批次 65 至 output_frames\\batch_65\n",
      "已缓存帧：2/23%\n",
      "已保存批次 66 至 output_frames\\batch_66\n",
      "已缓存帧：2/26%\n",
      "已保存批次 67 至 output_frames\\batch_67\n",
      "已缓存帧：2/20%\n",
      "已保存批次 68 至 output_frames\\batch_68\n",
      "已缓存帧：2/23%\n",
      "已保存批次 69 至 output_frames\\batch_69\n",
      "已缓存帧：2/27%\n",
      "已保存批次 70 至 output_frames\\batch_70\n",
      "已缓存帧：2/20%\n",
      "已保存批次 71 至 output_frames\\batch_71\n",
      "已缓存帧：2/24%\n",
      "已保存批次 72 至 output_frames\\batch_72\n",
      "已缓存帧：2/27%\n",
      "已保存批次 73 至 output_frames\\batch_73\n",
      "已缓存帧：2/21%\n",
      "已保存批次 74 至 output_frames\\batch_74\n",
      "已缓存帧：2/24%\n",
      "已保存批次 75 至 output_frames\\batch_75\n",
      "已缓存帧：2/28%\n",
      "已保存批次 76 至 output_frames\\batch_76\n",
      "已缓存帧：2/21%\n",
      "已保存批次 77 至 output_frames\\batch_77\n",
      "已缓存帧：2/25%\n",
      "已保存批次 78 至 output_frames\\batch_78\n",
      "已缓存帧：2/28%\n",
      "已保存批次 79 至 output_frames\\batch_79\n",
      "已缓存帧：2/22%\n",
      "已保存批次 80 至 output_frames\\batch_80\n",
      "已缓存帧：2/25%\n",
      "已保存批次 81 至 output_frames\\batch_81\n",
      "已缓存帧：2/29%\n",
      "已保存批次 82 至 output_frames\\batch_82\n",
      "已缓存帧：2/22%\n",
      "已保存批次 83 至 output_frames\\batch_83\n",
      "已缓存帧：2/26%\n",
      "已保存批次 84 至 output_frames\\batch_84\n",
      "已缓存帧：2/29%\n",
      "已保存批次 85 至 output_frames\\batch_85\n",
      "已缓存帧：2/23%\n",
      "已保存批次 86 至 output_frames\\batch_86\n",
      "已缓存帧：2/26%\n",
      "已保存批次 87 至 output_frames\\batch_87\n",
      "已缓存帧：2/20%\n",
      "已保存批次 88 至 output_frames\\batch_88\n",
      "已缓存帧：2/23%\n",
      "已保存批次 89 至 output_frames\\batch_89\n",
      "已缓存帧：2/26%\n",
      "已保存批次 90 至 output_frames\\batch_90\n",
      "已缓存帧：2/20%\n",
      "已保存批次 91 至 output_frames\\batch_91\n",
      "已缓存帧：2/23%\n",
      "已保存批次 92 至 output_frames\\batch_92\n",
      "已缓存帧：2/27%\n",
      "已保存批次 93 至 output_frames\\batch_93\n",
      "已缓存帧：2/20%\n",
      "已保存批次 94 至 output_frames\\batch_94\n",
      "已缓存帧：2/24%\n",
      "已保存批次 95 至 output_frames\\batch_95\n",
      "已缓存帧：2/27%\n",
      "已保存批次 96 至 output_frames\\batch_96\n",
      "已缓存帧：2/21%\n",
      "已保存批次 97 至 output_frames\\batch_97\n",
      "已缓存帧：2/24%\n",
      "已保存批次 98 至 output_frames\\batch_98\n",
      "已缓存帧：2/28%\n",
      "已保存批次 99 至 output_frames\\batch_99\n",
      "已缓存帧：2/21%\n",
      "已保存批次 100 至 output_frames\\batch_100\n",
      "已缓存帧：2/25%\n",
      "已保存批次 101 至 output_frames\\batch_101\n",
      "已缓存帧：2/28%\n",
      "已保存批次 102 至 output_frames\\batch_102\n",
      "已缓存帧：2/22%\n",
      "已保存批次 103 至 output_frames\\batch_103\n",
      "已缓存帧：2/25%\n",
      "已保存批次 104 至 output_frames\\batch_104\n",
      "已缓存帧：2/29%\n",
      "已保存批次 105 至 output_frames\\batch_105\n",
      "已缓存帧：2/22%\n",
      "已保存批次 106 至 output_frames\\batch_106\n",
      "已缓存帧：2/26%\n",
      "已保存批次 107 至 output_frames\\batch_107\n",
      "已缓存帧：2/29%\n",
      "已保存批次 108 至 output_frames\\batch_108\n",
      "已缓存帧：2/23%\n",
      "已保存批次 109 至 output_frames\\batch_109\n",
      "已缓存帧：2/26%\n",
      "已保存批次 110 至 output_frames\\batch_110\n",
      "已缓存帧：2/29%\n",
      "已保存批次 111 至 output_frames\\batch_111\n",
      "已缓存帧：2/23%\n",
      "已保存批次 112 至 output_frames\\batch_112\n",
      "已缓存帧：2/26%\n",
      "已保存批次 113 至 output_frames\\batch_113\n",
      "已缓存帧：2/20%\n",
      "已保存批次 114 至 output_frames\\batch_114\n",
      "已缓存帧：2/23%\n",
      "已保存批次 115 至 output_frames\\batch_115\n",
      "已缓存帧：2/27%\n",
      "已保存批次 116 至 output_frames\\batch_116\n",
      "已缓存帧：2/20%\n",
      "已保存批次 117 至 output_frames\\batch_117\n",
      "已缓存帧：2/24%\n",
      "已保存批次 118 至 output_frames\\batch_118\n",
      "已缓存帧：2/27%\n",
      "已保存批次 119 至 output_frames\\batch_119\n",
      "已缓存帧：2/21%\n",
      "已保存批次 120 至 output_frames\\batch_120\n",
      "已缓存帧：2/24%\n",
      "已保存批次 121 至 output_frames\\batch_121\n",
      "已缓存帧：2/28%\n",
      "已保存批次 122 至 output_frames\\batch_122\n",
      "已缓存帧：2/21%\n",
      "已保存批次 123 至 output_frames\\batch_123\n",
      "已缓存帧：2/25%\n",
      "已保存批次 124 至 output_frames\\batch_124\n",
      "已缓存帧：2/28%\n",
      "已保存批次 125 至 output_frames\\batch_125\n",
      "已缓存帧：2/22%\n",
      "已保存批次 126 至 output_frames\\batch_126\n",
      "已缓存帧：2/25%\n",
      "已保存批次 127 至 output_frames\\batch_127\n",
      "已缓存帧：2/29%\n",
      "已保存批次 128 至 output_frames\\batch_128\n",
      "已缓存帧：2/22%\n",
      "已保存批次 129 至 output_frames\\batch_129\n",
      "已缓存帧：2/26%\n",
      "已保存批次 130 至 output_frames\\batch_130\n",
      "已缓存帧：2/29%\n",
      "已保存批次 131 至 output_frames\\batch_131\n",
      "已缓存帧：2/23%\n",
      "已保存批次 132 至 output_frames\\batch_132\n",
      "已缓存帧：2/26%\n",
      "已保存批次 133 至 output_frames\\batch_133\n",
      "已缓存帧：2/29%\n",
      "已保存批次 134 至 output_frames\\batch_134\n",
      "已缓存帧：2/23%\n",
      "已保存批次 135 至 output_frames\\batch_135\n",
      "已缓存帧：2/26%\n",
      "已保存批次 136 至 output_frames\\batch_136\n",
      "已缓存帧：2/20%\n",
      "已保存批次 137 至 output_frames\\batch_137\n",
      "已缓存帧：2/23%\n",
      "已保存批次 138 至 output_frames\\batch_138\n",
      "已缓存帧：2/27%\n",
      "已保存批次 139 至 output_frames\\batch_139\n",
      "已缓存帧：2/20%\n",
      "已保存批次 140 至 output_frames\\batch_140\n",
      "已缓存帧：2/24%\n",
      "已保存批次 141 至 output_frames\\batch_141\n",
      "已缓存帧：2/27%\n",
      "已保存批次 142 至 output_frames\\batch_142\n",
      "已缓存帧：2/21%\n",
      "已保存批次 143 至 output_frames\\batch_143\n",
      "已缓存帧：2/24%\n",
      "已保存批次 144 至 output_frames\\batch_144\n",
      "已缓存帧：2/28%\n",
      "已保存批次 145 至 output_frames\\batch_145\n",
      "已缓存帧：2/21%\n",
      "已保存批次 146 至 output_frames\\batch_146\n",
      "已缓存帧：2/25%\n",
      "已保存批次 147 至 output_frames\\batch_147\n",
      "已缓存帧：2/28%\n",
      "已保存批次 148 至 output_frames\\batch_148\n",
      "已缓存帧：2/22%\n",
      "已保存批次 149 至 output_frames\\batch_149\n",
      "已缓存帧：2/25%\n",
      "已保存批次 150 至 output_frames\\batch_150\n",
      "已缓存帧：2/29%\n",
      "已保存批次 151 至 output_frames\\batch_151\n",
      "已缓存帧：2/22%\n",
      "已保存批次 152 至 output_frames\\batch_152\n",
      "已缓存帧：2/26%\n",
      "已保存批次 153 至 output_frames\\batch_153\n",
      "已缓存帧：2/29%\n",
      "已保存批次 154 至 output_frames\\batch_154\n",
      "已缓存帧：2/22%\n",
      "已保存批次 155 至 output_frames\\batch_155\n",
      "已缓存帧：2/26%\n",
      "已保存批次 156 至 output_frames\\batch_156\n",
      "已缓存帧：2/29%\n",
      "已保存批次 157 至 output_frames\\batch_157\n",
      "已缓存帧：2/23%\n",
      "已保存批次 158 至 output_frames\\batch_158\n",
      "已缓存帧：2/26%\n",
      "已保存批次 159 至 output_frames\\batch_159\n",
      "已缓存帧：2/20%\n",
      "已保存批次 160 至 output_frames\\batch_160\n",
      "已缓存帧：2/23%\n",
      "已保存批次 161 至 output_frames\\batch_161\n",
      "已缓存帧：2/27%\n",
      "已保存批次 162 至 output_frames\\batch_162\n",
      "已缓存帧：2/20%\n",
      "已保存批次 163 至 output_frames\\batch_163\n",
      "已缓存帧：2/24%\n",
      "已保存批次 164 至 output_frames\\batch_164\n",
      "已缓存帧：2/27%\n",
      "已保存批次 165 至 output_frames\\batch_165\n",
      "已缓存帧：2/21%\n",
      "已保存批次 166 至 output_frames\\batch_166\n",
      "已缓存帧：2/24%\n",
      "已保存批次 167 至 output_frames\\batch_167\n",
      "已缓存帧：2/28%\n",
      "已保存批次 168 至 output_frames\\batch_168\n",
      "已缓存帧：2/21%\n",
      "已保存批次 169 至 output_frames\\batch_169\n",
      "已缓存帧：2/25%\n",
      "已保存批次 170 至 output_frames\\batch_170\n",
      "已缓存帧：2/28%\n",
      "已保存批次 171 至 output_frames\\batch_171\n",
      "已缓存帧：2/22%\n",
      "已保存批次 172 至 output_frames\\batch_172\n",
      "已缓存帧：2/25%\n",
      "已保存批次 173 至 output_frames\\batch_173\n",
      "已缓存帧：2/29%\n",
      "已保存批次 174 至 output_frames\\batch_174\n",
      "已缓存帧：2/22%\n",
      "已保存批次 175 至 output_frames\\batch_175\n",
      "已缓存帧：2/26%\n",
      "已保存批次 176 至 output_frames\\batch_176\n",
      "已缓存帧：2/29%\n",
      "已保存批次 177 至 output_frames\\batch_177\n",
      "已缓存帧：2/22%\n",
      "已保存批次 178 至 output_frames\\batch_178\n",
      "已缓存帧：2/26%\n",
      "已保存批次 179 至 output_frames\\batch_179\n",
      "已缓存帧：2/29%\n",
      "已保存批次 180 至 output_frames\\batch_180\n",
      "已缓存帧：2/23%\n",
      "已保存批次 181 至 output_frames\\batch_181\n",
      "已缓存帧：2/26%\n",
      "已保存批次 182 至 output_frames\\batch_182\n",
      "已缓存帧：2/20%\n",
      "已保存批次 183 至 output_frames\\batch_183\n",
      "已缓存帧：2/23%\n",
      "已保存批次 184 至 output_frames\\batch_184\n",
      "已缓存帧：2/27%\n",
      "已保存批次 185 至 output_frames\\batch_185\n",
      "已缓存帧：2/20%\n",
      "已保存批次 186 至 output_frames\\batch_186\n",
      "已缓存帧：2/24%\n",
      "已保存批次 187 至 output_frames\\batch_187\n",
      "已缓存帧：2/27%\n",
      "已保存批次 188 至 output_frames\\batch_188\n",
      "已缓存帧：2/21%\n",
      "已保存批次 189 至 output_frames\\batch_189\n",
      "已缓存帧：2/24%\n",
      "已保存批次 190 至 output_frames\\batch_190\n",
      "已缓存帧：2/28%\n",
      "已保存批次 191 至 output_frames\\batch_191\n",
      "已缓存帧：2/21%\n",
      "已保存批次 192 至 output_frames\\batch_192\n",
      "已缓存帧：2/25%\n",
      "已保存批次 193 至 output_frames\\batch_193\n",
      "已缓存帧：2/28%\n",
      "已保存批次 194 至 output_frames\\batch_194\n",
      "已缓存帧：2/22%\n",
      "已保存批次 195 至 output_frames\\batch_195\n",
      "已缓存帧：2/25%\n",
      "已保存批次 196 至 output_frames\\batch_196\n",
      "已缓存帧：2/29%\n",
      "已保存批次 197 至 output_frames\\batch_197\n",
      "已缓存帧：2/22%\n",
      "已保存批次 198 至 output_frames\\batch_198\n",
      "已缓存帧：2/26%\n",
      "已保存批次 199 至 output_frames\\batch_199\n",
      "已缓存帧：2/29%\n",
      "已保存批次 200 至 output_frames\\batch_200\n",
      "已缓存帧：2/22%\n",
      "已保存批次 201 至 output_frames\\batch_201\n",
      "已缓存帧：2/26%\n",
      "已保存批次 202 至 output_frames\\batch_202\n",
      "已缓存帧：2/29%\n",
      "已保存批次 203 至 output_frames\\batch_203\n",
      "已缓存帧：2/23%\n",
      "已保存批次 204 至 output_frames\\batch_204\n",
      "已缓存帧：2/26%\n",
      "已保存批次 205 至 output_frames\\batch_205\n",
      "已缓存帧：2/20%\n",
      "已保存批次 206 至 output_frames\\batch_206\n",
      "已缓存帧：2/23%\n",
      "已保存批次 207 至 output_frames\\batch_207\n",
      "已缓存帧：2/27%\n",
      "已保存批次 208 至 output_frames\\batch_208\n",
      "已缓存帧：2/20%\n",
      "已保存批次 209 至 output_frames\\batch_209\n",
      "已缓存帧：2/24%\n",
      "已保存批次 210 至 output_frames\\batch_210\n",
      "已缓存帧：2/27%\n",
      "已保存批次 211 至 output_frames\\batch_211\n",
      "已缓存帧：2/21%\n",
      "已保存批次 212 至 output_frames\\batch_212\n",
      "已缓存帧：2/24%\n",
      "已保存批次 213 至 output_frames\\batch_213\n",
      "已缓存帧：2/28%\n",
      "已保存批次 214 至 output_frames\\batch_214\n",
      "已缓存帧：2/21%\n",
      "已保存批次 215 至 output_frames\\batch_215\n",
      "已缓存帧：2/25%\n",
      "已保存批次 216 至 output_frames\\batch_216\n",
      "已缓存帧：2/28%\n",
      "已保存批次 217 至 output_frames\\batch_217\n",
      "已缓存帧：2/22%\n",
      "已保存批次 218 至 output_frames\\batch_218\n",
      "已缓存帧：2/25%\n",
      "已保存批次 219 至 output_frames\\batch_219\n",
      "已缓存帧：2/29%\n",
      "已保存批次 220 至 output_frames\\batch_220\n",
      "已缓存帧：2/22%\n",
      "已保存批次 221 至 output_frames\\batch_221\n",
      "已缓存帧：2/25%\n",
      "已保存批次 222 至 output_frames\\batch_222\n",
      "已缓存帧：2/29%\n",
      "已保存批次 223 至 output_frames\\batch_223\n",
      "已缓存帧：2/22%\n",
      "已保存批次 224 至 output_frames\\batch_224\n",
      "已缓存帧：2/26%\n",
      "已保存批次 225 至 output_frames\\batch_225\n",
      "已缓存帧：2/29%\n",
      "已保存批次 226 至 output_frames\\batch_226\n",
      "已缓存帧：2/23%\n",
      "已保存批次 227 至 output_frames\\batch_227\n",
      "已缓存帧：2/26%\n",
      "已保存批次 228 至 output_frames\\batch_228\n",
      "已缓存帧：2/20%\n",
      "已保存批次 229 至 output_frames\\batch_229\n",
      "已缓存帧：2/23%\n",
      "已保存批次 230 至 output_frames\\batch_230\n",
      "已缓存帧：2/27%\n",
      "已保存批次 231 至 output_frames\\batch_231\n",
      "已缓存帧：2/20%\n",
      "已保存批次 232 至 output_frames\\batch_232\n",
      "已缓存帧：2/24%\n",
      "已保存批次 233 至 output_frames\\batch_233\n",
      "已缓存帧：2/27%\n",
      "已保存批次 234 至 output_frames\\batch_234\n",
      "已缓存帧：2/21%\n",
      "已保存批次 235 至 output_frames\\batch_235\n",
      "已缓存帧：2/24%\n",
      "已保存批次 236 至 output_frames\\batch_236\n",
      "已缓存帧：2/28%\n",
      "已保存批次 237 至 output_frames\\batch_237\n",
      "已缓存帧：2/21%\n",
      "已保存批次 238 至 output_frames\\batch_238\n",
      "已缓存帧：2/25%\n",
      "已保存批次 239 至 output_frames\\batch_239\n",
      "已缓存帧：2/28%\n",
      "已保存批次 240 至 output_frames\\batch_240\n",
      "已缓存帧：2/22%\n",
      "已保存批次 241 至 output_frames\\batch_241\n",
      "已缓存帧：2/25%\n",
      "已保存批次 242 至 output_frames\\batch_242\n",
      "已缓存帧：2/29%\n",
      "已保存批次 243 至 output_frames\\batch_243\n",
      "已缓存帧：2/22%\n",
      "已保存批次 244 至 output_frames\\batch_244\n",
      "已缓存帧：2/25%\n",
      "已保存批次 245 至 output_frames\\batch_245\n",
      "已缓存帧：2/29%\n",
      "已保存批次 246 至 output_frames\\batch_246\n",
      "已缓存帧：2/22%\n",
      "已保存批次 247 至 output_frames\\batch_247\n",
      "已缓存帧：2/26%\n",
      "已保存批次 248 至 output_frames\\batch_248\n",
      "已缓存帧：2/29%\n",
      "已保存批次 249 至 output_frames\\batch_249\n",
      "已缓存帧：2/23%\n",
      "已保存批次 250 至 output_frames\\batch_250\n",
      "已缓存帧：2/26%\n",
      "已保存批次 251 至 output_frames\\batch_251\n",
      "已缓存帧：2/20%\n",
      "已保存批次 252 至 output_frames\\batch_252\n",
      "已缓存帧：2/23%\n",
      "已保存批次 253 至 output_frames\\batch_253\n",
      "已缓存帧：2/27%\n",
      "已保存批次 254 至 output_frames\\batch_254\n",
      "已缓存帧：2/20%\n",
      "已保存批次 255 至 output_frames\\batch_255\n",
      "已缓存帧：2/24%\n",
      "已保存批次 256 至 output_frames\\batch_256\n",
      "已缓存帧：2/27%\n",
      "已保存批次 257 至 output_frames\\batch_257\n",
      "已缓存帧：2/21%\n",
      "已保存批次 258 至 output_frames\\batch_258\n",
      "已缓存帧：2/24%\n",
      "已保存批次 259 至 output_frames\\batch_259\n",
      "已缓存帧：2/28%\n",
      "已保存批次 260 至 output_frames\\batch_260\n",
      "已缓存帧：2/21%\n",
      "已保存批次 261 至 output_frames\\batch_261\n",
      "已缓存帧：2/25%\n",
      "已保存批次 262 至 output_frames\\batch_262\n",
      "已缓存帧：2/28%\n",
      "已保存批次 263 至 output_frames\\batch_263\n",
      "已缓存帧：2/22%\n",
      "已保存批次 264 至 output_frames\\batch_264\n",
      "已缓存帧：2/25%\n",
      "已保存批次 265 至 output_frames\\batch_265\n",
      "已缓存帧：2/29%\n",
      "已保存批次 266 至 output_frames\\batch_266\n",
      "已缓存帧：2/22%\n",
      "已保存批次 267 至 output_frames\\batch_267\n",
      "已缓存帧：2/25%\n",
      "已保存批次 268 至 output_frames\\batch_268\n",
      "已缓存帧：2/29%\n",
      "已保存批次 269 至 output_frames\\batch_269\n",
      "已缓存帧：2/22%\n",
      "已保存批次 270 至 output_frames\\batch_270\n",
      "已缓存帧：2/26%\n",
      "已保存批次 271 至 output_frames\\batch_271\n",
      "已缓存帧：2/29%\n",
      "已保存批次 272 至 output_frames\\batch_272\n",
      "已缓存帧：2/23%\n",
      "已保存批次 273 至 output_frames\\batch_273\n",
      "已缓存帧：2/26%\n",
      "已保存批次 274 至 output_frames\\batch_274\n",
      "已缓存帧：2/20%\n",
      "已保存批次 275 至 output_frames\\batch_275\n",
      "已缓存帧：2/23%\n",
      "已保存批次 276 至 output_frames\\batch_276\n",
      "已缓存帧：2/27%\n",
      "已保存批次 277 至 output_frames\\batch_277\n",
      "已缓存帧：2/20%\n",
      "已保存批次 278 至 output_frames\\batch_278\n",
      "已缓存帧：2/24%\n",
      "已保存批次 279 至 output_frames\\batch_279\n",
      "已缓存帧：2/27%\n",
      "已保存批次 280 至 output_frames\\batch_280\n",
      "已缓存帧：2/21%\n",
      "已保存批次 281 至 output_frames\\batch_281\n",
      "已缓存帧：2/24%\n",
      "已保存批次 282 至 output_frames\\batch_282\n",
      "已缓存帧：2/28%\n",
      "已保存批次 283 至 output_frames\\batch_283\n",
      "已缓存帧：2/21%\n",
      "已保存批次 284 至 output_frames\\batch_284\n",
      "已缓存帧：2/25%\n",
      "已保存批次 285 至 output_frames\\batch_285\n",
      "已缓存帧：2/28%\n",
      "已保存批次 286 至 output_frames\\batch_286\n",
      "处理进度：100.0%\r\n",
      "处理完成！\n"
     ]
    }
   ],
   "execution_count": 4
  },
  {
   "metadata": {},
   "cell_type": "code",
   "outputs": [],
   "execution_count": null,
   "source": "",
   "id": "44faf25b13e37189"
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
